// erasing from map
#include <iostream>
#include <string>
#include <map>

using namespace std;

int main ()
{
		map<string,int> mymap;
		map<string,int>::iterator it;
		string var = "a";

		// insert some values:
		mymap["a"]=10;
		mymap["b"]=20;
		mymap["c"]=30;
		mymap["d"]=40;
		mymap["e"]=50;
		mymap["f"]=60;

		cout << mymap.size() << endl;
		it=mymap.find("b");
		mymap.erase (it);                   // erasing by iterator

		mymap.erase ("c");                  // erasing by key
		mymap.erase (var);                  // erasing by key

		it=mymap.find ("e");
		mymap.erase ( it, mymap.end() );    // erasing by range

		cout << mymap.size() << endl;

		// show content:
		for ( it=mymap.begin() ; it != mymap.end(); it++ )
				cout << (*it).first << " => " << (*it).second << endl;

		return 0;
}

